using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._DistributedGeodatabase
{
    /// <summary>
    /// <para>Synchronize Changes</para>
    /// <para>Synchronizes updates between two replica geodatabases in a specified direction.</para>
    /// <para>在指定方向上同步两个复本地理数据库之间的更新。</para>
    /// </summary>    
    [DisplayName("Synchronize Changes")]
    public class SynchronizeChanges : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SynchronizeChanges()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_geodatabase_1">
        /// <para>Geodatabase 1</para>
        /// <para>The geodatabase hosting the replica to synchronize. The geodatabase can be local or remote.</para>
        /// <para>托管要同步的复本的地理数据库。地理数据库可以是本地的，也可以是远程的。</para>
        /// </param>
        /// <param name="_in_replica">
        /// <para>Replica</para>
        /// <para>A valid replica with a parent contained in one input geodatabase and a child in the other input geodatabase.</para>
        /// <para>一个有效复本，其父级包含在一个输入地理数据库中，而子级包含在另一个输入地理数据库中。</para>
        /// </param>
        /// <param name="_geodatabase_2">
        /// <para>Geodatabase 2</para>
        /// <para>The geodatabase hosting the relative replica. The geodatabase can be local or remote.</para>
        /// <para>托管相对复本的地理数据库。地理数据库可以是本地的，也可以是远程的。</para>
        /// </param>
        /// <param name="_in_direction">
        /// <para>Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction in which the changes will be synchronized: from geodatabase 1 to geodatabase 2, from geodatabase 2 to geodatabase 1, or in both directions. For check-out/check-in replicas or one-way replicas, there is only one appropriate direction. If the replica is two-way, all of the choices are available.</para>
        ///   <bulletList>
        ///     <bullet_item>Both directions—Changes will be synchronized in both directions. This is the default.</bullet_item><para/>
        ///     <bullet_item>From geodatabase 2 to geodatabase 1—Changes will be synchronized from geodatabase 2 to geodatabase 1.</bullet_item><para/>
        ///     <bullet_item>From geodatabase 1 to geodatabase 2—Changes will be synchronized from geodatabase 1 to geodatabase 2.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定更改的同步方向：从地理数据库 1 到地理数据库 2，从地理数据库 2 到地理数据库 1，或双向。对于检出/检入副本或单向副本，只有一个适当的方向。如果复本是双向的，则所有选项都可用。</para>
        ///   <bulletList>
        ///     <bullet_item>两个方向—更改将在两个方向上同步。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>从地理数据库 2 到地理数据库 1 - 更改将从地理数据库 2 同步到地理数据库 1。</bullet_item><para/>
        ///     <bullet_item>从地理数据库 1 到地理数据库 2 - 更改将从地理数据库 1 同步到地理数据库 2。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_conflict_policy">
        /// <para>Conflict Resolution Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies how conflicts will be resolved when they are encountered.</para>
        ///   <bulletList>
        ///     <bullet_item>Manually resolve conflicts—Conflicts will be resolved manually in the versioning reconcile environment.</bullet_item><para/>
        ///     <bullet_item>Resolve in favor of geodatabase 1—Conflicts will be resolved in favor of geodatabase 1. This is the default.</bullet_item><para/>
        ///     <bullet_item>Resolve in favor of geodatabase 2—Conflicts will be resolved in favor of geodatabase 2.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定遇到冲突时如何解决冲突。</para>
        ///   <bulletList>
        ///     <bullet_item>手动解决冲突 - 冲突将在版本控制协调环境中手动解决。</bullet_item><para/>
        ///     <bullet_item>解决以支持地理数据库 1 - 冲突将解决以支持地理数据库 1。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>解决以支持地理数据库 2 - 冲突将得到解决以支持地理数据库 2。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_conflict_definition">
        /// <para>Conflict Definition</para>
        /// <para><xdoc>
        ///   <para>Specifies how conflicts will be defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Conflicts defined by row—Changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.</bullet_item><para/>
        ///     <bullet_item>Conflicts defined by column— Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to different attributes will not be considered a conflict during reconcile.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何定义冲突。</para>
        ///   <bulletList>
        ///     <bullet_item>按行定义的冲突 - 在协调过程中，对父版本和子版本中同一行或要素的更改将发生冲突。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>列定义的冲突 - 在协调期间，只有对父版本和子版本中同一行或要素的同一属性（列）所做的更改才会被标记为冲突。在协调过程中，对不同属性的更改不会被视为冲突。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_reconcile">
        /// <para>Reconcile with the Parent Version (Checkout only)</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to automatically reconcile once data changes are sent to the parent replica if there are no conflicts present. This option is only available for check-out/check-in replicas.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not reconcile with the parent version. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Reconcile with the parent version.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在将数据更改发送到父副本时，如果不存在冲突，是否自动进行协调。此选项仅适用于检出/检入副本。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不与父版本协调。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 与父版本协调。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SynchronizeChanges(object _geodatabase_1, object _in_replica, object _geodatabase_2, _in_direction_value? _in_direction, _conflict_policy_value _conflict_policy, _conflict_definition_value _conflict_definition, _reconcile_value _reconcile)
        {
            this._geodatabase_1 = _geodatabase_1;
            this._in_replica = _in_replica;
            this._geodatabase_2 = _geodatabase_2;
            this._in_direction = _in_direction;
            this._conflict_policy = _conflict_policy;
            this._conflict_definition = _conflict_definition;
            this._reconcile = _reconcile;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Synchronize Changes";

        public override string CallName => "management.SynchronizeChanges";

        public override List<string> AcceptEnvironments => ["geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_geodatabase_1, _in_replica, _geodatabase_2, _in_direction.GetGPValue(), _conflict_policy.GetGPValue(), _conflict_definition.GetGPValue(), _reconcile.GetGPValue(), _out_geodatabase_1, _out_geodatabase_2];

        /// <summary>
        /// <para>Geodatabase 1</para>
        /// <para>The geodatabase hosting the replica to synchronize. The geodatabase can be local or remote.</para>
        /// <para>托管要同步的复本的地理数据库。地理数据库可以是本地的，也可以是远程的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Geodatabase 1")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _geodatabase_1 { get; set; }


        /// <summary>
        /// <para>Replica</para>
        /// <para>A valid replica with a parent contained in one input geodatabase and a child in the other input geodatabase.</para>
        /// <para>一个有效复本，其父级包含在一个输入地理数据库中，而子级包含在另一个输入地理数据库中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Replica")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_replica { get; set; }


        /// <summary>
        /// <para>Geodatabase 2</para>
        /// <para>The geodatabase hosting the relative replica. The geodatabase can be local or remote.</para>
        /// <para>托管相对复本的地理数据库。地理数据库可以是本地的，也可以是远程的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Geodatabase 2")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _geodatabase_2 { get; set; }


        /// <summary>
        /// <para>Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction in which the changes will be synchronized: from geodatabase 1 to geodatabase 2, from geodatabase 2 to geodatabase 1, or in both directions. For check-out/check-in replicas or one-way replicas, there is only one appropriate direction. If the replica is two-way, all of the choices are available.</para>
        ///   <bulletList>
        ///     <bullet_item>Both directions—Changes will be synchronized in both directions. This is the default.</bullet_item><para/>
        ///     <bullet_item>From geodatabase 2 to geodatabase 1—Changes will be synchronized from geodatabase 2 to geodatabase 1.</bullet_item><para/>
        ///     <bullet_item>From geodatabase 1 to geodatabase 2—Changes will be synchronized from geodatabase 1 to geodatabase 2.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定更改的同步方向：从地理数据库 1 到地理数据库 2，从地理数据库 2 到地理数据库 1，或双向。对于检出/检入副本或单向副本，只有一个适当的方向。如果复本是双向的，则所有选项都可用。</para>
        ///   <bulletList>
        ///     <bullet_item>两个方向—更改将在两个方向上同步。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>从地理数据库 2 到地理数据库 1 - 更改将从地理数据库 2 同步到地理数据库 1。</bullet_item><para/>
        ///     <bullet_item>从地理数据库 1 到地理数据库 2 - 更改将从地理数据库 1 同步到地理数据库 2。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Direction")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _in_direction_value? _in_direction { get; set; }

        public enum _in_direction_value
        {
            /// <summary>
            /// <para>Both directions</para>
            /// <para>Both directions—Changes will be synchronized in both directions. This is the default.</para>
            /// <para>两个方向—更改将在两个方向上同步。这是默认设置。</para>
            /// </summary>
            [Description("Both directions")]
            [GPEnumValue("BOTH_DIRECTIONS")]
            _BOTH_DIRECTIONS,

            /// <summary>
            /// <para>From geodatabase 2 to geodatabase 1</para>
            /// <para>From geodatabase 2 to geodatabase 1—Changes will be synchronized from geodatabase 2 to geodatabase 1.</para>
            /// <para>从地理数据库 2 到地理数据库 1 - 更改将从地理数据库 2 同步到地理数据库 1。</para>
            /// </summary>
            [Description("From geodatabase 2 to geodatabase 1")]
            [GPEnumValue("FROM_GEODATABASE2_TO_1")]
            _FROM_GEODATABASE2_TO_1,

            /// <summary>
            /// <para>From geodatabase 1 to geodatabase 2</para>
            /// <para>From geodatabase 1 to geodatabase 2—Changes will be synchronized from geodatabase 1 to geodatabase 2.</para>
            /// <para>从地理数据库 1 到地理数据库 2 - 更改将从地理数据库 1 同步到地理数据库 2。</para>
            /// </summary>
            [Description("From geodatabase 1 to geodatabase 2")]
            [GPEnumValue("FROM_GEODATABASE1_TO_2")]
            _FROM_GEODATABASE1_TO_2,

        }

        /// <summary>
        /// <para>Conflict Resolution Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies how conflicts will be resolved when they are encountered.</para>
        ///   <bulletList>
        ///     <bullet_item>Manually resolve conflicts—Conflicts will be resolved manually in the versioning reconcile environment.</bullet_item><para/>
        ///     <bullet_item>Resolve in favor of geodatabase 1—Conflicts will be resolved in favor of geodatabase 1. This is the default.</bullet_item><para/>
        ///     <bullet_item>Resolve in favor of geodatabase 2—Conflicts will be resolved in favor of geodatabase 2.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定遇到冲突时如何解决冲突。</para>
        ///   <bulletList>
        ///     <bullet_item>手动解决冲突 - 冲突将在版本控制协调环境中手动解决。</bullet_item><para/>
        ///     <bullet_item>解决以支持地理数据库 1 - 冲突将解决以支持地理数据库 1。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>解决以支持地理数据库 2 - 冲突将得到解决以支持地理数据库 2。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Resolution Policy")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _conflict_policy_value _conflict_policy { get; set; }

        public enum _conflict_policy_value
        {
            /// <summary>
            /// <para>Resolve in favor of geodatabase 1</para>
            /// <para>Resolve in favor of geodatabase 1—Conflicts will be resolved in favor of geodatabase 1. This is the default.</para>
            /// <para>解决以支持地理数据库 1 - 冲突将解决以支持地理数据库 1。这是默认设置。</para>
            /// </summary>
            [Description("Resolve in favor of geodatabase 1")]
            [GPEnumValue("IN_FAVOR_OF_GDB1")]
            _IN_FAVOR_OF_GDB1,

            /// <summary>
            /// <para>Resolve in favor of geodatabase 2</para>
            /// <para>Resolve in favor of geodatabase 2—Conflicts will be resolved in favor of geodatabase 2.</para>
            /// <para>解决以支持地理数据库 2 - 冲突将得到解决以支持地理数据库 2。</para>
            /// </summary>
            [Description("Resolve in favor of geodatabase 2")]
            [GPEnumValue("IN_FAVOR_OF_GDB2")]
            _IN_FAVOR_OF_GDB2,

            /// <summary>
            /// <para>Manually resolve conflicts</para>
            /// <para>Manually resolve conflicts—Conflicts will be resolved manually in the versioning reconcile environment.</para>
            /// <para>手动解决冲突 - 冲突将在版本控制协调环境中手动解决。</para>
            /// </summary>
            [Description("Manually resolve conflicts")]
            [GPEnumValue("MANUAL")]
            _MANUAL,

        }

        /// <summary>
        /// <para>Conflict Definition</para>
        /// <para><xdoc>
        ///   <para>Specifies how conflicts will be defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Conflicts defined by row—Changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.</bullet_item><para/>
        ///     <bullet_item>Conflicts defined by column— Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to different attributes will not be considered a conflict during reconcile.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何定义冲突。</para>
        ///   <bulletList>
        ///     <bullet_item>按行定义的冲突 - 在协调过程中，对父版本和子版本中同一行或要素的更改将发生冲突。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>列定义的冲突 - 在协调期间，只有对父版本和子版本中同一行或要素的同一属性（列）所做的更改才会被标记为冲突。在协调过程中，对不同属性的更改不会被视为冲突。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Definition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _conflict_definition_value _conflict_definition { get; set; }

        public enum _conflict_definition_value
        {
            /// <summary>
            /// <para>Conflicts defined by row</para>
            /// <para>Conflicts defined by row—Changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.</para>
            /// <para>按行定义的冲突 - 在协调过程中，对父版本和子版本中同一行或要素的更改将发生冲突。这是默认设置。</para>
            /// </summary>
            [Description("Conflicts defined by row")]
            [GPEnumValue("BY_OBJECT")]
            _BY_OBJECT,

            /// <summary>
            /// <para>Conflicts defined by column</para>
            /// <para>Conflicts defined by column— Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to different attributes will not be considered a conflict during reconcile.</para>
            /// <para>列定义的冲突 - 在协调期间，只有对父版本和子版本中同一行或要素的同一属性（列）所做的更改才会被标记为冲突。在协调过程中，对不同属性的更改不会被视为冲突。</para>
            /// </summary>
            [Description("Conflicts defined by column")]
            [GPEnumValue("BY_ATTRIBUTE")]
            _BY_ATTRIBUTE,

        }

        /// <summary>
        /// <para>Reconcile with the Parent Version (Checkout only)</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to automatically reconcile once data changes are sent to the parent replica if there are no conflicts present. This option is only available for check-out/check-in replicas.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not reconcile with the parent version. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Reconcile with the parent version.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在将数据更改发送到父副本时，如果不存在冲突，是否自动进行协调。此选项仅适用于检出/检入副本。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不与父版本协调。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 与父版本协调。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reconcile with the Parent Version (Checkout only)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _reconcile_value _reconcile { get; set; }

        public enum _reconcile_value
        {
            /// <summary>
            /// <para>RECONCILE </para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RECONCILE ")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_RECONCILE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_RECONCILE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Geodatabase 1</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Geodatabase 1")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_geodatabase_1 { get; set; }


        /// <summary>
        /// <para>Output Geodatabase 2</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Geodatabase 2")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_geodatabase_2 { get; set; }


        public SynchronizeChanges SetEnv(object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}